#ifndef LNUMBER
#define LNUMBER

#include<string>

#include "NumArray.h"
using namespace std;

struct LargeNumber {
        LargeNumber();
        explicit LargeNumber(NumArray const & num, bool is_negative = false);
        explicit LargeNumber(size_t const & size_);
        LargeNumber(long const & value);
        LargeNumber & operator+=(LargeNumber const & right);
        LargeNumber & operator-=(LargeNumber const & right);
        LargeNumber & operator*=(LargeNumber const & right);
        bool operator<(LargeNumber const & right) const;
        bool operator>(LargeNumber const & right) const;
        void swap(LargeNumber & right);
        friend LargeNumber abs(LargeNumber const & number);
        friend ostream & operator <<(ostream & out, LargeNumber const & number);
        friend istream & operator >>(istream & in, LargeNumber & number);
private:
        NumArray number_;
        bool isNegative_;
        LargeNumber & plus(LargeNumber right);
        LargeNumber & minus(LargeNumber right);
        void resize(size_t new_size);
        void minusIter(int & minuend, int const & subtrahend, int & remember);
        LargeNumber & multiplication(LargeNumber const & right);
};

LargeNumber operator+(LargeNumber left, LargeNumber const & right);
LargeNumber operator-(LargeNumber left, LargeNumber const & right);
LargeNumber operator*(LargeNumber left, LargeNumber const & right);


#endif
